package com;

import java.util.Comparator;

import com.Student;

public class GFSFareClassOccurrence{

	private Integer override994TableNum;
	
	private Integer indicator;

	/**
	 * This method is used to get the indicator
	 * @return indicator - Integer
	 */
	
	public Integer getIndicator() {
		return indicator;
	}

	/**
	 * This method is used to set the indicator
	 * @param indicator - Integer
	 */
	
	public void setIndicator(Integer indicator) {
		this.indicator = indicator;
	}

	/**
	 * This method is used to get the override994TableNum
	 * @return override994TableNum - Integer
	 */
	
	public Integer getOverride994TableNum() {
		return override994TableNum;
	}

	/**
	 * This method is used to set the override994TableNum
	 * @param override994TableNum - Integer
	 */
	
	public void setOverride994TableNum(Integer override994TableNum) {
		this.override994TableNum = override994TableNum;
	}

    public static class Comparators {

    	public static Comparator<GFSFareClassOccurrence> INDICATOR = new Comparator<GFSFareClassOccurrence>() {
            
            public int compare(GFSFareClassOccurrence o1, GFSFareClassOccurrence o2) {
            	if (o1.getIndicator() == null && o2.getIndicator() != null)
        	        return -1;
        		
        		if (o1.getIndicator() != null && o2.getOverride994TableNum() == null)
        	        return 1;
        	    
        		return 0;
            }
        };
        
        public static Comparator<GFSFareClassOccurrence> override994Tablenum = new Comparator<GFSFareClassOccurrence>() {
            public int compare(GFSFareClassOccurrence gfsFcOcc1, GFSFareClassOccurrence gfsFcOcc2) {
            	if (gfsFcOcc1.getOverride994TableNum() == null && gfsFcOcc2.getOverride994TableNum() != null)
        	        return -1;
        		
        		if (gfsFcOcc1.getOverride994TableNum() != null && gfsFcOcc2.getOverride994TableNum() == null)
        	        return 1;
        	
        		return 0;
            }
        };
        
        private static Comparator<Student> AGE = new Comparator<Student>() {
            
            public int compare(Student o1, Student o2) {
                return o1.age - o2.age;
            }
        };
        private static Comparator<Student> NAMEANDAGE = new Comparator<Student>() {
            
            public int compare(Student o1, Student o2) {
                int i = o1.name.compareTo(o2.name);
                if (i == 0) {
                    i = o1.age - o2.age;
                }
                return i;
            }
        };
    }
}
